package com.shop.controller;

import com.shop.entity.MerchantMerchant;
import com.shop.model.vo.Rsp;
import com.shop.service.ApplyService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@AllArgsConstructor
@RestController
@Validated
public class ApplyController {

    private final ApplyService applyService;

    @GetMapping("getApplyInfo")
    public Rsp getApplyInfo(@RequestHeader("userId") int userId){
        return applyService.getApplyInfo(userId);
    }

    @PostMapping("ApplyMerchant")
    public Rsp ApplyMerchant( @RequestHeader("userId") int userId,@RequestBody MerchantMerchant merchant){
        return applyService.addMerchant(userId,merchant);
    }

}
